<template>
  <div class="students-container">
    <el-card class="box-card" shadow="never">
      <template #header>
        <div class="card-header">
          <h2 class="card-title">学生管理</h2>
          <div class="header-actions">
            <div class="search-box">
              <el-input v-model="searchQuery" placeholder="搜索学号/姓名" clearable @clear="handleSearch" class="search-input">
                <template #prefix>
                  <el-icon>
                    <Search />
                  </el-icon>
                </template>
              </el-input>
              <el-select v-model="genderFilter" placeholder="性别筛选" clearable @change="handleSearch" class="gender-filter">
                <el-option label="全部" value="" />
                <el-option label="男" value="男" />
                <el-option label="女" value="女" />
              </el-select>
              <el-button type="primary" @click="handleSearch" :icon="Search">搜索</el-button>
            </div>
            <el-button type="success" @click="handleAdd" :icon="Plus">添加学生</el-button>
            <el-button type="primary" @click="handleBatchImport" :icon="Upload">批量导入</el-button>
          </div>
        </div>
      </template>

      <div class="table-container" v-loading="loading" element-loading-text="加载中..." element-loading-background="rgba(255, 255, 255, 0.8)">
        <el-table :data="paginatedStudents" border style="width: 100%" row-key="stuId" highlight-current-row class="students-table" :header-cell-style="{ background: '#f5f7fa', color: '#606266', fontWeight: 'bold' }" empty-text="暂无数据" @selection-change="handleSelectionChange">
          <el-table-column type="selection" width="55" align="center" />
          <el-table-column prop="stuId" label="学号" min-width="120" align="center" />

          <el-table-column prop="name" label="姓名" min-width="120" align="center" />

          <el-table-column prop="gender" label="性别" width="80" align="center">
            <template #default="{ row }">
              <el-tag :type="row.gender === '男' ? 'primary' : 'danger'" effect="light">{{ row.gender }}</el-tag>
            </template>
          </el-table-column>

          <el-table-column label="头像" width="100" align="center">
            <template #default="{ row }">
              <el-avatar :size="40" :src="row.avatarUrl || defaultAvatar"></el-avatar>
            </template>
          </el-table-column>

          <el-table-column label="操作" width="250" align="center" fixed="right">
            <template #default="{ row }">
              <div class="action-buttons">
                <el-tooltip content="编辑信息" placement="top" :show-after="300">
                  <el-button type="primary" size="small" @click="handleEdit(row)" :icon="Edit" circle />
                </el-tooltip>
                <el-tooltip content="重置密码" placement="top" :show-after="300">
                  <el-button type="warning" size="small" @click="handleResetPassword(row)" :icon="Key" circle />
                </el-tooltip>
                <el-tooltip content="删除学生" placement="top" :show-after="300">
                  <el-button type="danger" size="small" @click="handleDelete(row)" :icon="Delete" circle />
                </el-tooltip>
              </div>
            </template>
          </el-table-column>
        </el-table>

        <div class="batch-actions" v-if="selectedStudents.length > 0">
          <el-alert title="" type="info" :closable="false" show-icon>
            <div class="batch-info">
              已选择 <span class="selected-count">{{ selectedStudents.length }}</span> 名学生
              <el-button type="danger" size="small" @click="handleBatchDelete">批量删除</el-button>
            </div>
          </el-alert>
        </div>

        <div class="pagination-container">
          <el-pagination v-model:current-page="currentPage" :page-size="pageSize" layout="total, prev, pager, next, jumper" :total="filteredStudents.length" @current-change="handleCurrentChange" />
        </div>
      </div>
    </el-card>

    <!-- 添加/编辑学生对话框 -->
    <el-dialog v-model="dialogVisible" :title="isEdit ? '编辑学生' : '添加学生'" width="500px" :close-on-click-modal="false" :show-close="true">
      <el-form ref="studentFormRef" :model="studentForm" :rules="formRules" label-width="80px" label-position="right" status-icon>
        <el-form-item label="学号" prop="stuId" :disabled="isEdit">
          <el-input v-model="studentForm.stuId" placeholder="请输入学号" :disabled="isEdit" />
        </el-form-item>

        <el-form-item label="姓名" prop="name">
          <el-input v-model="studentForm.name" placeholder="请输入姓名" />
        </el-form-item>

        <el-form-item label="性别" prop="gender">
          <el-radio-group v-model="studentForm.gender" @change="handleGenderChange">
            <el-radio label="男">男</el-radio>
            <el-radio label="女">女</el-radio>
          </el-radio-group>
        </el-form-item>

        <el-form-item v-if="!isEdit" label="密码" prop="password">
          <el-input v-model="studentForm.password" placeholder="请输入密码(为空则默认123456)" type="password" show-password />
        </el-form-item>
      </el-form>

      <template #footer>
        <div class="dialog-footer">
          <el-button @click="dialogVisible = false">取消</el-button>
          <el-button type="primary" @click="submitForm" :loading="submitting">确认</el-button>
        </div>
      </template>
    </el-dialog>

    <!-- 批量导入对话框 -->
    <el-dialog v-model="batchImportVisible" title="批量导入学生" width="600px" :close-on-click-modal="false">
      <div class="batch-import-container">
        <p class="import-tip">
          请按照如下格式填写学生信息，每行一条记录，字段之间使用逗号分隔：<br>
          <code>学号,姓名,性别(男/女)</code>
        </p>
        <p class="import-example">
          示例：<br>
          <code>20230101,张三,男</code><br>
          <code>20230102,李四,男</code><br>
          <code>20230103,王五,女</code>
        </p>
        <el-input v-model="batchImportData" type="textarea" :rows="10" placeholder="请输入学生信息，格式：学号,姓名,性别" />
        <div class="import-preview" v-if="previewData.length > 0">
          <p>导入预览 (共 {{ previewData.length }} 条)</p>
          <el-table :data="previewData.slice(0, 5)" border size="small">
            <el-table-column prop="stuId" label="学号" width="120" />
            <el-table-column prop="name" label="姓名" width="120" />
            <el-table-column prop="gender" label="性别" width="80" />
          </el-table>
          <p v-if="previewData.length > 5" class="more-tip">还有 {{ previewData.length - 5 }} 条数据未显示</p>
        </div>
      </div>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="batchImportVisible = false">取消</el-button>
          <el-button type="primary" @click="handlePreviewImport">预览</el-button>
          <el-button type="success" @click="submitBatchImport" :loading="importing" :disabled="previewData.length === 0">
            导入
          </el-button>
        </span>
      </template>
    </el-dialog>
  </div>
</template>

<script setup>
import { ref, computed, onMounted, watch } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { Plus, Edit, Delete, Search, Key, Upload } from '@element-plus/icons-vue'
import { getStudentList, addStudent, updateStudent, resetPassword, deleteStudent, batchImportStudents } from '@/api/student'
import { checkStudentHasScores } from '@/api/score'

const defaultAvatar = 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png'

// 数据状态
const loading = ref(false)
const students = ref([])
const searchQuery = ref('')
const genderFilter = ref('')
const currentPage = ref(1)
const pageSize = ref(10)
const submitting = ref(false)

// 对话框状态
const dialogVisible = ref(false)
const isEdit = ref(false)
const studentFormRef = ref(null)

// 学生表单数据
const studentForm = ref({
  stuId: '',
  name: '',
  gender: '男',
  password: ''
})

// 在studentForm中添加一个字段存储原始性别
const originalGender = ref(null)

// 表单验证规则
const formRules = {
  stuId: [
    { required: true, message: '请输入学号', trigger: 'blur' },
    { pattern: /^\d{8,12}$/, message: '学号格式不正确', trigger: 'blur' }
  ],
  name: [
    { required: true, message: '请输入姓名', trigger: 'blur' },
    { min: 2, max: 20, message: '姓名长度在2-20个字符之间', trigger: 'blur' }
  ],
  gender: [
    { required: true, message: '请选择性别', trigger: 'change' }
  ]
}

// 过滤后的学生列表
const filteredStudents = computed(() => {
  let result = [...students.value]

  // 性别过滤
  if (genderFilter.value) {
    result = result.filter(item => item.gender === genderFilter.value)
  }

  // 关键词搜索
  if (searchQuery.value) {
    const keyword = searchQuery.value.toLowerCase()
    result = result.filter(item =>
      (item.stuId && item.stuId.toLowerCase().includes(keyword)) ||
      (item.name && item.name.toLowerCase().includes(keyword))
    )
  }

  return result
})

// 分页后的学生列表
const paginatedStudents = computed(() => {
  const start = (currentPage.value - 1) * pageSize.value
  const end = start + pageSize.value
  return filteredStudents.value.slice(start, end)
})

// 加载学生数据
const fetchStudents = async () => {
  loading.value = true
  try {
    const res = await getStudentList()
    if (res.code === 200) {
      students.value = res.data || []
    } else {
      ElMessage.error(res.message || '获取数据失败')
      students.value = []
    }
  } catch (error) {
    ElMessage.error('获取学生数据失败')
    students.value = []
  } finally {
    loading.value = false
  }
}

// 添加学生
const handleAdd = () => {
  isEdit.value = false
  studentForm.value = {
    stuId: '',
    name: '',
    gender: '男',
    password: ''
  }
  dialogVisible.value = true

  // 确保表单重置
  setTimeout(() => {
    studentFormRef.value?.clearValidate()
  }, 0)
}

// 编辑学生
const handleEdit = async (row) => {
  isEdit.value = true
  studentForm.value = {
    stuId: row.stuId,
    name: row.name,
    gender: row.gender
  }

  // 保存原始性别值
  originalGender.value = row.gender

  dialogVisible.value = true

  // 确保表单重置
  setTimeout(() => {
    studentFormRef.value?.clearValidate()
  }, 0)
}

// 添加监听性别变化的函数
const handleGenderChange = async (newGender) => {
  // 只有在编辑模式且性别确实发生变化时才检查
  if (isEdit.value && originalGender.value && newGender !== originalGender.value) {
    try {
      // 检查学生是否有成绩记录
      const res = await checkStudentHasScores(studentForm.value.stuId)

      if (res.code === 200 && res.data === true) {
        // 有成绩记录，不允许修改性别
        ElMessageBox.alert(
          '该学生已有体测成绩记录，不能修改性别。如需修改，请先删除该学生的所有成绩记录。',
          '无法修改性别',
          {
            confirmButtonText: '确定',
            type: 'warning',
          }
        ).then(() => {
          // 恢复原始性别
          studentForm.value.gender = originalGender.value
        })
      }
    } catch (error) {
      console.error('检查学生成绩记录失败:', error)
      // 发生错误时，出于安全考虑也恢复原始性别
      studentForm.value.gender = originalGender.value
      ElMessage.error('检查学生成绩记录失败')
    }
  }
}

// 提交表单
const submitForm = async () => {
  if (!studentFormRef.value) return

  await studentFormRef.value.validate(async (valid) => {
    if (valid) {
      submitting.value = true
      try {
        let res
        if (isEdit.value) {
          // 更新学生
          const { stuId, ...updateData } = studentForm.value
          res = await updateStudent(stuId, updateData)
        } else {
          // 添加学生
          res = await addStudent(studentForm.value)
        }

        if (res.code === 200) {
          ElMessage.success(isEdit.value ? '更新成功' : '添加成功')
          dialogVisible.value = false
          await fetchStudents() // 刷新数据
        } else {
          // 根据错误码和消息提供具体的错误提示
          if (res.code === 400 && res.message.includes('学号已存在')) {
            ElMessage.error(`学号 ${studentForm.value.stuId} 已存在，请使用其他学号`)
          } else {
            ElMessage.error(res.message || '操作失败')
          }
        }
      } catch (error) {
        if (error.response && error.response.data) {
          // 使用后端返回的详细错误信息
          const errorData = error.response.data
          if (errorData.message && errorData.message.includes('学号已存在')) {
            ElMessage.error(`学号 ${studentForm.value.stuId} 已存在，请使用其他学号`)
          } else {
            ElMessage.error(errorData.message || '操作失败，请重试')
          }
        } else {
          ElMessage.error('操作失败，请重试')
        }
      } finally {
        submitting.value = false
      }
    }
  })
}

// 重置密码
const handleResetPassword = (row) => {
  ElMessageBox.confirm(
    `确定要重置学生"${row.name}"的密码吗？重置后密码将变为"123456"`,
    '重置密码确认',
    {
      confirmButtonText: '确定',
      cancelButtonText: '取消',
      type: 'warning'
    }
  ).then(async () => {
    try {
      const res = await resetPassword(row.stuId)
      if (res.code === 200) {
        ElMessage.success('密码重置成功')
      } else {
        ElMessage.error(res.message || '密码重置失败')
      }
    } catch (error) {
      ElMessage.error('密码重置失败，请重试')
    }
  }).catch(() => { })
}

// 删除学生
const handleDelete = (row) => {
  ElMessageBox.confirm(
    `确定要删除学生"${row.name}"吗？删除后该学生的所有信息将被清除，包括所有体测成绩数据`,
    '删除确认',
    {
      confirmButtonText: '确定删除',
      cancelButtonText: '取消',
      type: 'warning',
      distinguishCancelAndClose: true,
      closeOnClickModal: false,
      dangerouslyUseHTMLString: true,
      customClass: 'custom-message-box'
    }
  ).then(async () => {
    try {
      const res = await deleteStudent(row.stuId)
      if (res.code === 200) {
        ElMessage({
          type: 'success',
          message: '删除学生成功',
          duration: 2000
        })
        await fetchStudents() // 刷新数据
      } else {
        // 如果有特殊状态码，给出更友好的提示
        if (res.code === 409) {
          ElMessage({
            type: 'warning',
            message: res.message,
            duration: 3000,
            showClose: true
          })
        } else {
          ElMessage.error(res.message || '删除失败')
        }
      }
    } catch (error) {
      // 处理可能的错误响应
      if (error.response && error.response.data) {
        const errorData = error.response.data

        // 处理外键约束违反的情况 (HTTP 409)
        if (errorData.code === 409) {
          // 这种情况下，后端会发回一个询问是否确认删除的消息
          // 因为学生有关联的成绩记录
          ElMessageBox.confirm(
            errorData.message || '该学生有关联的体测成绩，删除学生将同时删除其所有成绩记录。确定继续吗？',
            '操作确认',
            {
              confirmButtonText: '确认删除',
              cancelButtonText: '取消',
              type: 'warning',
              distinguishCancelAndClose: true,
              closeOnClickModal: false,
              customClass: 'warning-message-box'
            }
          ).then(async () => {
            // 用户确认后再次发起删除请求
            try {
              const confirmRes = await deleteStudent(row.stuId)
              if (confirmRes.code === 200) {
                ElMessage.success('删除成功')
                await fetchStudents() // 刷新数据
              } else {
                ElMessage.error(confirmRes.message || '删除失败')
              }
            } catch (confirmError) {
              ElMessage.error('删除操作失败，请重试')
            }
          }).catch(() => {
            // 用户取消删除
            ElMessage({
              type: 'info',
              message: '已取消删除操作'
            })
          })
        } else {
          // 其他类型的错误
          ElMessage({
            type: 'error',
            message: errorData.message || '删除学生失败',
            duration: 3000,
            showClose: true
          })
        }
      } else {
        // 网络错误或其他未知错误
        ElMessage({
          type: 'error',
          message: '删除学生失败，请检查网络连接后重试',
          duration: 3000,
          showClose: true
        })
      }
    }
  }).catch(() => {
    // 用户取消删除
    ElMessage({
      type: 'info',
      message: '已取消删除操作'
    })
  })
}

// 处理搜索
const handleSearch = () => {
  currentPage.value = 1
}

// 处理分页变化
const handleCurrentChange = (val) => {
  currentPage.value = val
}

// 监听筛选器变化
watch([searchQuery, genderFilter], () => {
  currentPage.value = 1
})

// 批量导入相关
const batchImportVisible = ref(false)
const batchImportData = ref('')
const previewData = ref([])
const importing = ref(false)

// 处理批量导入
const handleBatchImport = () => {
  batchImportVisible.value = true
  batchImportData.value = ''
  previewData.value = []
}

// 预览导入数据
const handlePreviewImport = () => {
  if (!batchImportData.value.trim()) {
    ElMessage.warning('请输入学生信息')
    return
  }

  const lines = batchImportData.value.split('\n').filter(line => line.trim() !== '')
  const importData = []
  const errorLines = []

  lines.forEach((line, index) => {
    const parts = line.split(',').map(p => p.trim())
    if (parts.length < 3) {
      errorLines.push(`第${index + 1}行: 字段不足，至少需要学号、姓名和性别`)
      return
    }

    const [stuId, name, gender] = parts
    if (!stuId) {
      errorLines.push(`第${index + 1}行: 学号不能为空`)
      return
    }
    if (!name) {
      errorLines.push(`第${index + 1}行: 姓名不能为空`)
      return
    }
    if (gender !== '男' && gender !== '女') {
      errorLines.push(`第${index + 1}行: 性别必须是"男"或"女"`)
      return
    }

    importData.push({ stuId, name, gender })
  })

  if (errorLines.length > 0) {
    ElMessage.error(`存在${errorLines.length}行数据格式错误，请修正后重试\n${errorLines.slice(0, 3).join('\n')}${errorLines.length > 3 ? '\n...' : ''}`)
    return
  }

  previewData.value = importData
  ElMessage.success(`已解析${importData.length}条数据，请查看预览并确认`)
}

// 提交批量导入
const submitBatchImport = async () => {
  if (previewData.value.length === 0) {
    ElMessage.warning('没有可导入的数据')
    return
  }

  importing.value = true
  try {
    // 创建FormData并添加学生数据
    const formData = new FormData()
    const studentsBlob = new Blob([JSON.stringify(previewData.value)], { type: 'application/json' })
    formData.append('students', studentsBlob, 'students.json')

    const res = await batchImportStudents(formData)
    if (res.code === 200) {
      ElMessage.success(`成功导入${previewData.value.length}条学生数据`)
      batchImportVisible.value = false
      await fetchStudents() // 刷新数据
    } else {
      // 针对批量导入的具体错误提供更明确的反馈
      if (res.code === 400) {
        if (res.message.includes('学号') && res.message.includes('已存在')) {
          // 提取具体的学号信息
          const stuIdMatch = res.message.match(/学号\s*([^\s]+)\s*已存在/)
          const stuId = stuIdMatch ? stuIdMatch[1] : '某个学号'
          ElMessage.error(`导入失败：学号 ${stuId} 已存在，请检查数据后重试`)
        } else {
          ElMessage.error(`导入失败：${res.message}`)
        }
      } else {
        ElMessage.error(res.message || '批量导入失败')
      }
    }
  } catch (error) {
    if (error.response && error.response.data) {
      const errorData = error.response.data
      if (errorData.message) {
        if (errorData.message.includes('学号') && errorData.message.includes('已存在')) {
          // 提取具体的学号信息
          const stuIdMatch = errorData.message.match(/学号\s*([^\s]+)\s*已存在/)
          const stuId = stuIdMatch ? stuIdMatch[1] : '某个学号'
          ElMessage.error(`导入失败：学号 ${stuId} 已存在，请检查数据后重试`)
        } else {
          ElMessage.error(`导入失败：${errorData.message}`)
        }
      } else {
        ElMessage.error('批量导入失败，请重试')
      }
    } else {
      ElMessage.error('批量导入失败，请重试')
    }
  } finally {
    importing.value = false
  }
}

// 批量操作相关
const selectedStudents = ref([])

// 表格选择项改变
const handleSelectionChange = (selection) => {
  selectedStudents.value = selection
}

// 批量删除
const handleBatchDelete = () => {
  if (selectedStudents.value.length === 0) {
    ElMessage.warning('请先选择要删除的学生')
    return
  }

  const studentNames = selectedStudents.value.map(student => student.name).join('、')
  const displayNames = studentNames.length > 30
    ? studentNames.substring(0, 30) + '...'
    : studentNames

  ElMessageBox.confirm(
    `确定要删除选中的 <strong>${selectedStudents.value.length}</strong> 名学生吗？<br>
    包括：${displayNames}<br><br>
    <span style="color: #e6a23c; font-weight: bold;">注意：</span> 删除学生将同时删除这些学生的所有体测成绩记录！`,
    '批量删除确认',
    {
      confirmButtonText: '确定删除',
      cancelButtonText: '取消',
      type: 'warning',
      distinguishCancelAndClose: true,
      closeOnClickModal: false,
      dangerouslyUseHTMLString: true,
      customClass: 'custom-message-box'
    }
  ).then(async () => {
    try {
      loading.value = true
      const deletePromises = selectedStudents.value.map(student =>
        deleteStudent(student.stuId)
      )

      const results = await Promise.allSettled(deletePromises)
      const successCount = results.filter(result => result.status === 'fulfilled' && result.value.code === 200).length
      const failCount = selectedStudents.value.length - successCount

      if (successCount > 0) {
        ElMessage({
          type: 'success',
          message: `成功删除 ${successCount} 名学生`,
          duration: 2000
        })
      }

      if (failCount > 0) {
        ElMessage({
          type: 'warning',
          message: `${failCount} 名学生删除失败`,
          duration: 3000,
          showClose: true
        })
      }

      // 刷新数据
      await fetchStudents()
    } catch (error) {
      ElMessage({
        type: 'error',
        message: '批量删除学生失败，请重试',
        duration: 3000,
        showClose: true
      })
    }
  }).catch(() => {
    // 用户取消删除
    ElMessage({
      type: 'info',
      message: '已取消批量删除操作'
    })
  })
}

// 初始化
onMounted(() => {
  fetchStudents()
})
</script>

<style scoped>
.students-container {
  padding: 16px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.card-title {
  margin: 0;
  font-size: 18px;
  color: #303133;
}

.header-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.search-box {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-input {
  width: 240px;
}

.gender-filter {
  width: 120px;
}

.table-container {
  margin-top: 20px;
}

.students-table {
  margin-bottom: 20px;
}

.action-buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.pagination-container {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

/* 响应式适配 */
@media (max-width: 768px) {
  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    flex-direction: column;
    width: 100%;
  }

  .search-box {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .search-input,
  .gender-filter {
    width: 100%;
  }
}

/* 批量导入样式 */
.batch-import-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.import-tip {
  margin: 0;
  color: #606266;
  line-height: 1.6;
}

.import-example {
  margin: 0;
  padding: 12px;
  background-color: #f5f7fa;
  border-radius: 4px;
  color: #606266;
  line-height: 1.6;
}

code {
  font-family: monospace;
  color: #409EFF;
  background-color: #ecf5ff;
  padding: 2px 4px;
  border-radius: 2px;
}

.import-preview {
  margin-top: 16px;
  border: 1px solid #ebeef5;
  border-radius: 4px;
  padding: 16px;
}

.more-tip {
  color: #909399;
  font-size: 12px;
  margin-top: 8px;
  text-align: right;
}

/* 批量操作样式 */
.batch-actions {
  margin-bottom: 16px;
}

.batch-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.selected-count {
  font-weight: bold;
  color: #409EFF;
  padding: 0 4px;
}

/* 自定义弹窗样式 */
:deep(.custom-message-box) {
  width: 440px;
  border-radius: 8px;
}

:deep(.custom-message-box .el-message-box__header) {
  padding: 20px 20px 10px;
}

:deep(.custom-message-box .el-message-box__content) {
  padding: 20px;
  font-size: 15px;
  line-height: 1.6;
}

:deep(.custom-message-box .el-message-box__message p) {
  margin: 0;
  line-height: 1.6;
}

:deep(.warning-message-box .el-message-box__content) {
  background-color: #fef6e7;
  border-radius: 0 0 8px 8px;
}

:deep(.warning-message-box .el-message-box__title) {
  color: #e6a23c;
  font-weight: 600;
}

:deep(.el-message-box__btns .el-button--primary) {
  background-color: #f56c6c;
  border-color: #f56c6c;
  padding: 10px 20px;
}

:deep(.el-message-box__btns .el-button--primary:hover) {
  background-color: #f78989;
  border-color: #f78989;
}
</style>